package com.daiqile.mydesignview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.daiqile.mydesignview.MyView.MyTopBar;
import com.daiqile.mydesignview.MyView.TopBar;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TopBar myTopBar = (TopBar) findViewById(R.id.topbar);
        Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
        MyTopBar myTopBar1 = (MyTopBar)findViewById(R.id.mytopBar);
        myTopBar.setOnTopbarClickListener(new TopBar.topbarClickListener() {
            @Override
            public void leftClick() {
                finish();
            }

            @Override
            public void rightClick() {

            }
        });

        myTopBar1.setOnMyTopBarClickListen(new MyTopBar.MyTopBarClickListener() {
            @Override
            public void leftClick() {
                finish();
            }

            @Override
            public void rightClick() {

            }
        });

        toolbar.setTitle(" ");
        setSupportActionBar(toolbar);
        toolbar.setNavigationIcon(R.mipmap.icon_back);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
